using System;
using System.Collections.Generic;
using System.Text;
using Jabr.GUI.Forms;
using System.Diagnostics;
using System.Windows.Forms;

namespace Jabr.Logic.Exceptions.Handling
{
    class ExceptionHandlerFactory
    {
        static public AbstractExceptionHandler GetHandler(Form p_maf)
        {
            AbstractExceptionHandler eh = null;
            DebugHandler(ref eh, p_maf);
            ReleaseHandler(ref eh, p_maf);
            return eh;
        }

        [Conditional("DEBUG")]
        static private void DebugHandler(ref AbstractExceptionHandler o_aeh, Form p_maf)
        {
            o_aeh = new XMLExceptionHandler(new ExceptionDebugForm(), p_maf);
        }

        [Conditional("RELEASE")]
        static private void ReleaseHandler(ref AbstractExceptionHandler o_aeh, Form p_maf)
        {
            o_aeh = new XMLExceptionHandler(new ExceptionForm(), p_maf);
        }
    }
}
